#ifndef LOADINGCIRCLEDIALOG_H
#define LOADINGCIRCLEDIALOG_H

#include <QDialog>
#include <QTimer>
#include <QString>

class LoadingCircleDialog : public QDialog
{
    Q_OBJECT

public:
    explicit LoadingCircleDialog(QWidget *parent = nullptr);
    void showLoading(const QString &text = "加载中...");
    void hideLoading();
    void setText(const QString &text);

protected:
    void paintEvent(QPaintEvent *event) override;

private:
    int angle;
    QTimer *timer;
    QString displayText;
    QColor backgroundColor;
    QFont textFont;         // 新增字体控制
    int circleMargin;       // 圆圈边距
    int textVerticalOffset; // 文字垂直偏移量
};

#endif // LOADINGCIRCLEDIALOG_H
